feat: use drawer instead of popover for book filters #130
+462
−179
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR replaces the filter popover with the shadcn Drawer. The drawer slides in from the right on desktop and from the bottom on mobile. This improves accessibility by putting the filters in one dialog instead of a popover with more popups opening on top of it, and is implemented from the idea in this comment.
Changes include:
useIsMobilehook, built withuseSyncExternalStoreandmatchMedia, so the drawer direction updates live when the window is resizedBookFiltersinto the drawerBookFiltersnow consists only of the filter inputs, which makes it simpler and easier to reuseCloses #128